var date = new Date()

// 方式一：date.valueOf()
var timestamp = date.valueOf()

// 方式二：date.getTime()
timestamp = date.getTime()

// 方式三：+new Date()
timestamp = +new Date()

// 方式四：Date.now()
if (!Date.now) {
  Date.now = function () {
    return new Date().valueOf()
  }
}
timestamp = Date.now()

console.log(timestamp)
